package terra.network;

import terra.managers.MapManager;
import terra.model.MapObject;
import terra.network.packet.server.ChunkInfo;

public class NeighborsCalc implements Runnable {

	int startx,starty;
	public NeighborsCalc(int x, int y) {
		startx = x;
		starty = y;
	}

	@Override
	public void run() {
		for(int x = startx; x < startx+ChunkInfo.size;x++){
			for(int y = starty; y < starty+ChunkInfo.size;y++){
				MapObject obj = MapManager.getInstance().getTile(x, y);
				if (obj != null)
					obj.recalc();
			}
		}
	}

}
